import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine();
        char[] str = str1.toCharArray();
        reverse(str,0, str.length - 1);
        int start = 0;
        while (start < str.length){
             int end = start;
             while (end < str.length &&str[end] != ' '){
                     end++;
             }
             reverse(str,start,end -1);
             start = end+1;
        }
        String str2 = new String(str);
        System.out.println(str);
    }
     public static void reverse(char[] str,int head,int end){
        while (head < end){
            char ch = str[head];
            str[head] = str[end];
            str[end] = ch;
            head++;
            end--;
        }
     }
}
